<template>
	<view class="itembie">
		<view class="left">
			<text class="info">合伙省份</text>
			<text class="xing">*</text>
		</view>
		<view class="right1" style="margin-bottom: 16rpx;display: flex;justify-content: center;align-items: center;">
			<u-checkbox-group width="300rpx" style="margin:0 0 0rpx 40px;" @change="heHuoShengFenChange">
				<u-checkbox v-model="item.checked" v-for="(item, index) in heHuoShengFenData" :key="index"
					:name="item.id">{{item.name}}</u-checkbox>
			</u-checkbox-group>
		</view>
		<view class="back" @click="confirm()">
			提交申请
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				heHuoShengFenData: [],
				form: {

				}
			}
		},
		onLoad() {
			this.getHeHuoRen()
		},
		methods: {
			// 合伙人省份查询
			getHeHuoRen() {
				this.$axios.request(this.$api.ShiListApi, "GET", {
					pid: 0,
					hasTowner: 1
				}).then((val) => {

					this.heHuoShengFenData = val.data.map(items => {
						return {
							id: items.id,
							name: items.name
						}
					})
				})
			},
			// 获取省份id
			heHuoShengFenChange(e) {
				this.form.provinceIdList = e.join(',')
			},
			confirm(){
				this.$axios.request(this.$api.heHuoRenApi,"POST",this.form).then((val) => {
					this.$msg.toastCallback("提交成功",() => {
						uni.reLaunch({
							url:`/pages/mine/index`
						})
					})
				})
			}
		}
	}
</script>

<style scoped>
	.itembie {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: flex-start;
		width: 100%;
		/* height: 90rpx; */
		padding: 10rpx 32rpx 24rpx;
		background-color: #FFFFFF;
		margin-bottom: 8rpx;
		margin-bottom: 16rpx;
	}

	.left {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		width: 250rpx;
		height: 64rpx;
	}
	
	.back {
		position: fixed;
		left: 32rpx;
		bottom: 40rpx;
		width: 686rpx;
		height: 64rpx;
		opacity: 1;
		border-radius: 4rpx;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 64rpx;
		margin: 0 auto;
		text-align: center;
		color: #FFFFFF;
		opacity: 1;
		background-color: #2E6ADF;
	}

	.info,
	.xing {
		height: 80rpx;
		line-height: 80rpx;
		font-size: 30rpx;
		font-family: "PingFang SC";
		font-weight: 600;
		color: #333333;
		opacity: 1;
	}

	.xing {
		color: #FF2D55;
		font-size: 30;
		height: 64rpx;
		line-height: 64rpx;
		margin-left: 10rpx;
		padding-top: 7rpx;
	}

	.right {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 80rpx;
		line-height: 80rpx;
		font-size: 30rpx;
		font-weight: 300;
		color: #62656D;


	}
</style>